/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package idea.model.qnrlibrary;


import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;


/**
 *
 * @author rejun001
 */
@Entity
@Table( name = "graphical_widgets" )
@XmlRootElement
@NamedQueries( 
{
    @NamedQuery( name = "GraphicalWidgets.findAll" , query = "SELECT g FROM GraphicalWidgets g" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByWidgetId" , query = "SELECT g FROM GraphicalWidgets g WHERE g.widgetId = :widgetId" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByWidgetType" , query = "SELECT g FROM GraphicalWidgets g WHERE g.widgetType = :widgetType" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByDescription" , query = "SELECT g FROM GraphicalWidgets g WHERE g.description = :description" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByDefinition" , query = "SELECT g FROM GraphicalWidgets g WHERE g.definition = :definition" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByBbLeft" , query = "SELECT g FROM GraphicalWidgets g WHERE g.bbLeft = :bbLeft" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByBbTop" , query = "SELECT g FROM GraphicalWidgets g WHERE g.bbTop = :bbTop" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByBbRight" , query = "SELECT g FROM GraphicalWidgets g WHERE g.bbRight = :bbRight" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByBbBottom" , query = "SELECT g FROM GraphicalWidgets g WHERE g.bbBottom = :bbBottom" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByMirrorLtr" , query = "SELECT g FROM GraphicalWidgets g WHERE g.mirrorLtr = :mirrorLtr" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByToken" , query = "SELECT g FROM GraphicalWidgets g WHERE g.token = :token" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByCreatedBy" , query = "SELECT g FROM GraphicalWidgets g WHERE g.createdBy = :createdBy" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByDateCreated" , query = "SELECT g FROM GraphicalWidgets g WHERE g.dateCreated = :dateCreated" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByModifiedBy" , query = "SELECT g FROM GraphicalWidgets g WHERE g.modifiedBy = :modifiedBy" ) ,
    @NamedQuery( name = "GraphicalWidgets.findByDateModified" , query = "SELECT g FROM GraphicalWidgets g WHERE g.dateModified = :dateModified" )
} )
public class GraphicalWidgets implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @Basic( optional = false )
    @Column( name = "widget_id" )
    private String widgetId;
    @Basic( optional = false )
    @Column( name = "widget_type" )
    private String widgetType;
    @Basic( optional = false )
    @Column( name = "description" )
    private String description;
    @Basic( optional = false )
    @Column( name = "definition" )
    private String definition;
    @Basic( optional = false )
    @Column( name = "bb_left" )
    private String bbLeft;
    @Basic( optional = false )
    @Column( name = "bb_top" )
    private String bbTop;
    @Basic( optional = false )
    @Column( name = "bb_right" )
    private String bbRight;
    @Basic( optional = false )
    @Column( name = "bb_bottom" )
    private String bbBottom;
    @Column( name = "mirror_ltr" )
    private Character mirrorLtr;
    @Column( name = "token" )
    private String token;
    @Basic( optional = false )
    @Column( name = "created_by" )
    private String createdBy;
    @Basic( optional = false )
    @Column( name = "date_created" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateCreated;
    @Column( name = "modified_by" )
    private String modifiedBy;
    @Column( name = "date_modified" )
    @Temporal( TemporalType.TIMESTAMP )
    private Date dateModified;
    @OneToMany( mappedBy = "widgetId" )
    private Collection<PaperAttributeGroup> paperAttributeGroupCollection;


    public GraphicalWidgets()
    {
    }


    public GraphicalWidgets( String widgetId )
    {
        this.widgetId = widgetId;
    }


    public GraphicalWidgets( String widgetId , String widgetType , String description , String definition , String bbLeft , String bbTop , String bbRight , String bbBottom , String createdBy , Date dateCreated )
    {
        this.widgetId = widgetId;
        this.widgetType = widgetType;
        this.description = description;
        this.definition = definition;
        this.bbLeft = bbLeft;
        this.bbTop = bbTop;
        this.bbRight = bbRight;
        this.bbBottom = bbBottom;
        this.createdBy = createdBy;
        this.dateCreated = dateCreated;
    }


    public String getWidgetId()
    {
        return widgetId;
    }


    public void setWidgetId( String widgetId )
    {
        this.widgetId = widgetId;
    }


    public String getWidgetType()
    {
        return widgetType;
    }


    public void setWidgetType( String widgetType )
    {
        this.widgetType = widgetType;
    }


    public String getDescription()
    {
        return description;
    }


    public void setDescription( String description )
    {
        this.description = description;
    }


    public String getDefinition()
    {
        return definition;
    }


    public void setDefinition( String definition )
    {
        this.definition = definition;
    }


    public String getBbLeft()
    {
        return bbLeft;
    }


    public void setBbLeft( String bbLeft )
    {
        this.bbLeft = bbLeft;
    }


    public String getBbTop()
    {
        return bbTop;
    }


    public void setBbTop( String bbTop )
    {
        this.bbTop = bbTop;
    }


    public String getBbRight()
    {
        return bbRight;
    }


    public void setBbRight( String bbRight )
    {
        this.bbRight = bbRight;
    }


    public String getBbBottom()
    {
        return bbBottom;
    }


    public void setBbBottom( String bbBottom )
    {
        this.bbBottom = bbBottom;
    }


    public Character getMirrorLtr()
    {
        return mirrorLtr;
    }


    public void setMirrorLtr( Character mirrorLtr )
    {
        this.mirrorLtr = mirrorLtr;
    }


    public String getToken()
    {
        return token;
    }


    public void setToken( String token )
    {
        this.token = token;
    }


    public String getCreatedBy()
    {
        return createdBy;
    }


    public void setCreatedBy( String createdBy )
    {
        this.createdBy = createdBy;
    }


    public Date getDateCreated()
    {
        return dateCreated;
    }


    public void setDateCreated( Date dateCreated )
    {
        this.dateCreated = dateCreated;
    }


    public String getModifiedBy()
    {
        return modifiedBy;
    }


    public void setModifiedBy( String modifiedBy )
    {
        this.modifiedBy = modifiedBy;
    }


    public Date getDateModified()
    {
        return dateModified;
    }


    public void setDateModified( Date dateModified )
    {
        this.dateModified = dateModified;
    }


    @XmlTransient
    public Collection<PaperAttributeGroup> getPaperAttributeGroupCollection()
    {
        return paperAttributeGroupCollection;
    }


    public void setPaperAttributeGroupCollection( Collection<PaperAttributeGroup> paperAttributeGroupCollection )
    {
        this.paperAttributeGroupCollection = paperAttributeGroupCollection;
    }


    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += ( widgetId != null ? widgetId.hashCode() : 0 );
        return hash;
    }


    @Override
    public boolean equals( Object object )
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if ( !( object instanceof GraphicalWidgets ) )
        {
            return false;
        }
        GraphicalWidgets other = (GraphicalWidgets) object;
        if ( ( this.widgetId == null && other.widgetId != null ) || ( this.widgetId != null && !this.widgetId.equals( other.widgetId ) ) )
        {
            return false;
        }
        return true;
    }


    @Override
    public String toString()
    {
        return "idea.model.qnrlibrary.GraphicalWidgets[ widgetId=" + widgetId + " ]";
    }
    
}
